<?php
session_start();
$id = $_GET['bookId'];
$result = 0;
foreach ($_SESSION['cart'] as $key => $value) {
	if ($key == $id) unset($_SESSION['cart'][$key]);
}

foreach ($_SESSION ['cart'] as $value) {
	$result += $value;
}
echo json_encode($result);
return;
?>